home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / Chip Temmuz 2004.iso / program / antispam / RazorAgent_SDK / razor-agents-sdk-2.03.exe / URI-1.19 / t / old-relbase.t < prev    next >
Encoding:
Text File  |  2000-06-13  |  919 b   |  35 lines

  1. print "1..5\n";
  2.  
  3. use URI::URL;
  4.  
  5. # We used to have problems with URLs that used a base that was
  6. # not absolute itself.
  7.  
  8. $u1 = url("/foo/bar", "http://www.acme.com/");
  9. $u2 = url("../foo/", $u1);
  10. $u3 = url("zoo/foo", $u2);
  11.  
  12. $a1 = $u1->abs->as_string;
  13. $a2 = $u2->abs->as_string;
  14. $a3 = $u3->abs->as_string;
  15.  
  16. print "$a1\n$a2\n$a3\n";
  17.  
  18. print "not " unless $a1 eq "http://www.acme.com/foo/bar";
  19. print "ok 1\n";
  20. print "not " unless $a2 eq "http://www.acme.com/foo/";
  21. print "ok 2\n";
  22. print "not " unless $a3 eq "http://www.acme.com/foo/zoo/foo";
  23. print "ok 3\n";
  24.  
  25. # We used to have problems with URI::URL as the base class :-(
  26. $u4 = url("foo", "URI::URL");
  27. $a4 = $u4->abs;
  28. print "$a4\n";
  29. print "not " unless $u4 eq "foo" && $a4 eq "uri:/foo";
  30. print "ok 4\n";
  31.  
  32. # Test new_abs for URI::URL objects
  33. print "not " unless URI::URL->new_abs("foo", "http://foo/bar") eq "http://foo/foo";
  34. print "ok 5\n";
  35.